package DataAccess.Storage;

import java.io.Serializable;
import DataAccess.DBAccessor;
import DistSys.Templates;
import Element.*;
/**
 * Title:        iPAD
 * Description:
 * Copyright:    Copyright (c) 2002
 * Company:      ABB Inc.
 * @author Fangxing Li
 * @version 1.0
 */

public class ActiveElemForStorage implements Serializable{
  public static final long serialVersionUID=100205L;

  protected String sActiveLine;
  protected String sActiveCable;
  protected String sActiveLoad;
  protected String sActiveTxfm;
  protected String sActiveRegulator;
  protected String sActiveBreaker;
  protected String sActiveDrtBreaker;
  protected String sActiveFuse;
  protected String sActiveSwitch;
  protected String sActiveSwitch3;
  protected String sActiveSwitchGnd;
  protected String sActiveRecloser;
  protected String sActiveSect;
  protected String sActiveCap;
  protected String sActiveReactor;
  protected String sActiveSeriesCap;
  protected String sActiveMotor;
  protected String sActiveArrester;
  protected String sActiveCT;
  protected String sActivePT;
  protected String sActiveBus;
  protected String sActiveDG;
  protected String sActiveSource;
  protected String sActiveGroup;

  public ActiveElemForStorage() { }

  public void copyFromActiveTemp ( ){
       sActiveLine      = Line.objActiveTemp.getElemGeomObj().getName();
       sActiveCable     = Line.objActiveTemp2.getElemGeomObj().getName();
       sActiveLoad      = Load.objActiveTemp.getElemGeomObj().getName();
       sActiveTxfm      = Txfm.objActiveTemp.getElemGeomObj().getName();
       sActiveRegulator = Regulator.objActiveTemp.getElemGeomObj().getName();
       sActiveBreaker   = Breaker.objActiveTemp.getElemGeomObj().getName();
       sActiveDrtBreaker= DrtBreaker.objActiveTemp.getElemGeomObj().getName();
       sActiveFuse      = Fuse.objActiveTemp.getElemGeomObj().getName();
       sActiveSwitch    = Switch.objActiveTemp.getElemGeomObj().getName();
       sActiveSwitch3   = Switch3.objActiveTemp.getElemGeomObj().getName();
       sActiveSwitchGnd = SwitchGnd.objActiveTemp.getElemGeomObj().getName();
       sActiveRecloser  = Recloser.objActiveTemp.getElemGeomObj().getName();
       sActiveSect      = Sect.objActiveTemp.getElemGeomObj().getName();
       sActiveCap       = Cap.objActiveTemp.getElemGeomObj().getName();
       sActiveReactor   = Reactor.objActiveTemp.getElemGeomObj().getName();
       sActiveSeriesCap = SeriesCap.objActiveTemp.getElemGeomObj().getName();
       sActiveMotor     = Motor.objActiveTemp.getElemGeomObj().getName();
       sActiveArrester  = Arrester.objActiveTemp.getElemGeomObj().getName();
       sActiveCT        = CT.objActiveTemp.getElemGeomObj().getName();
       sActivePT        = PT.objActiveTemp.getElemGeomObj().getName();
       sActiveBus       = Bus.objActiveTemp.getElemGeomObj().getName();
       sActiveDG        = DG.objActiveTemp.getElemGeomObj().getName();
       sActiveSource    = Source.objActiveTemp.getElemGeomObj().getName();
       sActiveGroup     = Group.objActiveTemp.getElemGeomObj().getName();
  }

  public void copyToActiveTempFromThis( ){
      Line.objActiveTemp      = Templates.mapStringToObject( sActiveLine);
      Line.objActiveTemp2     = Templates.mapStringToObject( sActiveCable );
      Load.objActiveTemp      = Templates.mapStringToObject( sActiveLoad );
      Txfm.objActiveTemp      = Templates.mapStringToObject( sActiveTxfm );
      Regulator.objActiveTemp = Templates.mapStringToObject( sActiveRegulator );
      Breaker.objActiveTemp   = Templates.mapStringToObject( sActiveBreaker );
      DrtBreaker.objActiveTemp= Templates.mapStringToObject( sActiveDrtBreaker );
      Fuse.objActiveTemp      = Templates.mapStringToObject( sActiveFuse );
      Switch.objActiveTemp    = Templates.mapStringToObject( sActiveSwitch );
      Switch3.objActiveTemp   = Templates.mapStringToObject( sActiveSwitch3 );
      SwitchGnd.objActiveTemp = Templates.mapStringToObject( sActiveSwitchGnd );
      Recloser.objActiveTemp  = Templates.mapStringToObject( sActiveRecloser );
      Sect.objActiveTemp      = Templates.mapStringToObject( sActiveSect );
      Cap.objActiveTemp       = Templates.mapStringToObject( sActiveCap );
      Reactor.objActiveTemp   = Templates.mapStringToObject( sActiveReactor );
      SeriesCap.objActiveTemp = Templates.mapStringToObject( sActiveSeriesCap );
      Motor.objActiveTemp     = Templates.mapStringToObject( sActiveMotor );
      Arrester.objActiveTemp  = Templates.mapStringToObject( sActiveArrester );
      CT.objActiveTemp        = Templates.mapStringToObject( sActiveCT );
      PT.objActiveTemp        = Templates.mapStringToObject( sActivePT );
      Bus.objActiveTemp       = Templates.mapStringToObject( sActiveBus );
      DG.objActiveTemp        = Templates.mapStringToObject( sActiveDG );
      Source.objActiveTemp    = Templates.mapStringToObject( sActiveSource );
      Group.objActiveTemp     = Templates.mapStringToObject( sActiveGroup );
  }
}